package com.hl.ruoyizmhshop.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hl.ruoyizmhshop.mapper.UserBusinessSubscribeMapper;
import com.hl.ruoyizmhshop.domain.UserBusinessSubscribe;
import com.hl.ruoyizmhshop.service.IUserBusinessSubscribeService;

/**
 * 用户收藏商家Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-13
 */
@Service
public class UserBusinessSubscribeServiceImpl implements IUserBusinessSubscribeService 
{
    @Autowired
    private UserBusinessSubscribeMapper userBusinessSubscribeMapper;

    /**
     * 查询用户收藏商家
     * 
     * @param userId 用户收藏商家主键
     * @return 用户收藏商家
     */
    @Override
    public UserBusinessSubscribe selectUserBusinessSubscribeByUserId(Long userId)
    {
        return userBusinessSubscribeMapper.selectUserBusinessSubscribeByUserId(userId);
    }

    /**
     * 查询用户收藏商家列表
     * 
     * @param userBusinessSubscribe 用户收藏商家
     * @return 用户收藏商家
     */
    @Override
    public List<UserBusinessSubscribe> selectUserBusinessSubscribeList(UserBusinessSubscribe userBusinessSubscribe)
    {
        return userBusinessSubscribeMapper.selectUserBusinessSubscribeList(userBusinessSubscribe);
    }

    /**
     * 新增用户收藏商家
     * 
     * @param userBusinessSubscribe 用户收藏商家
     * @return 结果
     */
    @Override
    public int insertUserBusinessSubscribe(UserBusinessSubscribe userBusinessSubscribe)
    {
        userBusinessSubscribe.setCreateTime(DateUtils.getNowDate());
        return userBusinessSubscribeMapper.insertUserBusinessSubscribe(userBusinessSubscribe);
    }

    /**
     * 修改用户收藏商家
     * 
     * @param userBusinessSubscribe 用户收藏商家
     * @return 结果
     */
    @Override
    public int updateUserBusinessSubscribe(UserBusinessSubscribe userBusinessSubscribe)
    {
        return userBusinessSubscribeMapper.updateUserBusinessSubscribe(userBusinessSubscribe);
    }

    /**
     * 批量删除用户收藏商家
     * 
     * @param userIds 需要删除的用户收藏商家主键
     * @return 结果
     */
    @Override
    public int deleteUserBusinessSubscribeByUserIds(Long[] userIds)
    {
        return userBusinessSubscribeMapper.deleteUserBusinessSubscribeByUserIds(userIds);
    }

    /**
     * 删除用户收藏商家信息
     * 
     * @param userId 用户收藏商家主键
     * @return 结果
     */
    @Override
    public int deleteUserBusinessSubscribeByUserId(Long userId)
    {
        return userBusinessSubscribeMapper.deleteUserBusinessSubscribeByUserId(userId);
    }
}
